public class Example05 {
    public static void main(String[] args) {
        String s1 = "String";
        String s2 = "string";
        System.out.println("判断s1字符串对象是否以St开头："+s1.startsWith("Str"));
        System.out.println("判断s1字符串对象是否以ng结尾："+s1.endsWith("ng"));
        System.out.println("判断s1字符串对象是否以包含tri："+s1.contains("tri"));
        System.out.println("判断s1字符串对象是否为空："+s1.isEmpty());
        System.out.println("判断s1和s2是否相同："+s1.equals(s2));
        System.out.println("忽略大小写的情况下判断s1和s2是否相同："+s1.equalsIgnoreCase(s2));
        System.out.println("按Unicode比较s1和s2的大小："+s1.compareTo(s2));
    }
}
